package com.yf.dxapp.module.app.dal.mysql.appbanner;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import com.yf.dxapp.module.app.controller.admin.appbanner.vo.AppBannerPageReqVO;
import com.yf.dxapp.module.app.dal.dataobject.appbanner.AppBannerDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 广告图 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface AppBannerMapper extends BaseMapperX<AppBannerDO> {

    default PageResult<AppBannerDO> selectPage(AppBannerPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AppBannerDO>()
                .likeIfPresent(AppBannerDO::getName, reqVO.getName())
                .eqIfPresent(AppBannerDO::getImg, reqVO.getImg())
                .eqIfPresent(AppBannerDO::getType, reqVO.getType())
                .eqIfPresent(AppBannerDO::getUrl, reqVO.getUrl())
                .betweenIfPresent(AppBannerDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AppBannerDO::getId));
    }

}